Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround bug in EvtFormatMessage #105636

Merged
merged 3 commits into from
Jul 30, 2024
Merged

Workaround bug in EvtFormatMessage #105636

merged 3 commits into from
Jul 30, 2024

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Jul 29, 2024

Fix #100198.

This Windows API will still try to write to a buffer if you tell it the buffer is 0 length and the string you're reading happens to be 0 length. We previously avoided an AV here because we were passing a StringBuilder, but that changed with the interop generator refactoring which passed null. Avoid the bug that by passing in a 1-character buffer rather than null.

I've tested manually using the file provided in the issue repro. I'll poke around a bit to see if I can manage to get a regression test for this without using the customer file but for now just sharing the fix.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-eventlog
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use collection expressions? Other than that, looks good.

Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll poke around a bit to see if I can manage to get a regression test for this without using the customer file but for now just sharing the fix.

Yes that would be great.

Otherwise, this LGTM.

@ericstj
Copy link
Member Author

ericstj commented Jul 30, 2024

Corrected some mismatched active issues, filed a new active issue for a test crash in linq.expressions. With that BA is passing.

@ericstj ericstj merged commit ee3b1f0 into dotnet:main Jul 30, 2024
79 of 84 checks passed
@ericstj
Copy link
Member Author

ericstj commented Jul 31, 2024

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/10183531351

@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EventLogRecord.TaskDisplayName throws System.AccessViolationException and termintates the program
4 participants